home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d6 / glazer.arc / SAVHISTO.BAS < prev    next >
BASIC Source File  |  1988-10-07  |  1KB  |  34 lines

  1. 100 'Savings History ("SAVHISTORY")
  2. 110 CLS
  3. 120 COLOR 0,15 : PRINT "Savings History" : COLOR 15,0
  4. 130 DEFDBL A-Z
  5. 140 DEFINT M-N, Y
  6. 150 MONEYFMT$ = "$$##,###,###.##"
  7. 160 PRINT
  8. 170 '     Let user enter data
  9. 180 PRINT "Do not enter dollar signs or commas"
  10. 190 PRINT
  11. 200 INPUT "Initial deposit: ", DEPOSIT
  12. 210 INPUT "Annual growth rate in deposits (in percent): ", DEPOSITGROWTH
  13. 220 INPUT "Annual interest rate (in percent): ", AR
  14. 230 INPUT "Number of years: ", NYEARS
  15. 240 INPUT "Annual inflation rate (in percent): ", INFLATION
  16. 250 INPUT  "Marginal tax rate (in percent): ", TAXRATE
  17. 260 '     Initialize variables
  18. 270 RAFTERTAX = AR * (100 - TAXRATE) / 10000     'After-tax interest rate
  19. 280 BALANCE = DEPOSIT                            'Initial balance
  20. 290 PRINT: PRINT "Press space bar to see next year's results"
  21. 300 PRINT
  22. 310 '     Do yearly calculations
  23. 320 FOR YEAR = 1 TO NYEARS
  24. 330   WHILE INKEY$ = "" : WEND                   'Wait for user to press a key
  25. 340   PRINT :PRINT  "Year: "; YEAR
  26. 350   ADJUSTEDBAL = BALANCE * (1 + INFLATION / 100) ^ -YEAR
  27. 360   'Print results
  28. 370   PRINT  "Nominal balance "; TAB(30); USING MONEYFMT$; BALANCE
  29. 380   PRINT "Inflation-adjusted balance"; TAB(30); USING MONEYFMT$; ADJUSTEDBAL
  30. 390   'Next year's results
  31. 400   BALANCE = BALANCE * (1 + RAFTERTAX) + DEPOSIT * (1 + DEPOSITGROWTH / 100)                 ^ YEAR
  32. 410 NEXT YEAR
  33. 420 END
  34.